﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataAccess.Domain
{
    [Table("Product")]
    public class Product
    {
        [Key]
        public int Id { get; set; }
        [MaxLength(50)]
        [Required]
        public string Name { get; set; }
        [MaxLength(500)]
        [Required]
        public string  Detail { get; set; }
        [Required]
        public int Price { get; set; }
        [Required]
        public int Sale { get; set; }

        [Column(TypeName = "image")]
        public byte[] Image { get; set; }

        public int CategoryId { get; set; }

        public int BusinessId { get; set; }

        [ForeignKey("CategoryId")]
        public virtual Category Category { get; set; }

        [ForeignKey("BusinessId")]
        public virtual Business Business { get; set; }

    }
}
